<template>
	<view style="height: 100vh;background-color:grey;display:flex;justify-content: center;align-items: center;">
		<view style="width: 220rpx;height: 220rpx;">
			<x-lottie style="width:100%;height:100%;" :option="{
		                path:require('../../static/ka.json')
		}" />
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: null,
				roleType: ''
			};
		},
		mounted() {
			// // 关闭splash
			// // #ifdef APP-PLUS
			// plus.navigator.closeSplashscreen();
			// // #endif
		},
		created() {


		},
		onLoad() {
			this.operset();
		},
		methods: {
			operset() {
				this.$api.myCurrentRole().then((res) => {
					console.log(res.data.result, '出现自产自销')
					setTimeout(() => {
						switch (res.data.result) {
							case 1:
								uni.setTabBarItem({
									index: 0,
									text: "接单",
									visible: true,
									iconPath: '/path/to/iconPath',
									selectedIconPath: '/path/to/selectedIconPath',
									pagePath: "/pages/tabbar/clientEndTabbar/designerHome",
								})
								uni.switchTab({
									url: '/pages/tabbar/clientEndTabbar/designerHome'
								})
								break
							case 2:
								console.log(2222222)
								uni.setTabBarItem({
									index: 0,
									text: "新图纸",
									visible: true,
									iconPath: '/path/to/iconPath',
									selectedIconPath: '/path/to/selectedIconPath',
									pagePath: "/pages/tabbar/clientEndTabbar/factoryHome",
								})
								uni.switchTab({
									url: '/pages/tabbar/clientEndTabbar/factoryHome'
								})
								break
							case 3:
								uni.setTabBarItem({
									index: 0,
									text: "安装",
									visible: true,
									iconPath: '/path/to/iconPath',
									selectedIconPath: '/path/to/selectedIconPath',
									pagePath: "/pages/tabbar/clientEndTabbar/installHome",
								})
								uni.switchTab({
									url: '/pages/tabbar/clientEndTabbar/installHome'
								})
								break
							case 4:
								uni.setTabBarItem({
									index: 0,
									text: "首页",
									visible: true,
									iconPath: '/path/to/iconPath',
									selectedIconPath: '/path/to/selectedIconPath',
									pagePath: "/pages/tabbar/clientEndTabbar/ClientHome",
								})
								uni.switchTab({
									url: '/pages/tabbar/clientEndTabbar/ClientHome'
								})
								break
							default:
								break
						}
					}, 2000)
				})


			},
		},
	};
</script>

<style>
	page {
		background-color: grey
	}
</style>